package com._21cn.fetch.web;

import com._21cn.fetch.utils.Fetch020;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping({"/admin/fetch"})
public class FetchController
{
    @RequestMapping({"/doSave"})
    public void doSave(HttpServletRequest request, HttpServletResponse response, ModelMap model)
    {
        Fetch020 fetch020 = new Fetch020();
        String html = fetch020.getContent("");
        JSONObject jsonObject = JSONObject.parseObject(html);
        JSONObject obj = jsonObject.getJSONObject("article");
        String title = obj.getString("title");
        String content = obj.getJSONObject("articleData").getString("content");
        int mainColumnId = 1;
        String sourceName = "广州网";
        String postUrl = "http://admin.cms.qiaoliba.com/admin/article/article/save.do";
        fetch020.extractPictureListFromContent(content);
    }
}